﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Foothill.Master" AutoEventWireup="true" CodeBehind="User.aspx.cs" Inherits="Foothill.Web.UserProfile.User" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="user.css" type="text/css" />
    <link rel="stylesheet" href="pagination.css" type="text/css" />
    <script type="text/javascript">       
        $(function () {
            $("#tabs").tabs();
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div id="user-profile">
        <div id="user-top">
            <asp:Label ID="lblUserName" runat="server" CssClass="lblUserName" />  
            <div id="div-hlkEdit">
                <asp:HyperLink ID="hlkEdit" runat="server" Text="修改个人资料" NavigateUrl="~/UserProfile/EditProfile.aspx" CssClass="hlkEdit" />
            </div>
  
            <div id="div-imgLogo">
                <asp:Image ID="imgLogo" runat="server" CssClass="imgLogo" />   
            </div>
            <div class="clear"></div>
        </div> 

        <div>
            <table id="tbl-user-info">
                <tr>
                    <td colspan="2">
                        <asp:Image ID="imgUserProfile" runat="server" CssClass="imgUserProfile" />
                    </td>    
                </tr>
                <tr>
                    <td><asp:Label ID="lblEmail" runat="server" Text="Email:" /></td>
                    <td><asp:Label ID="lblEmailValue" runat="server" /></td>
                </tr>
                <tr>
                    <td><asp:Label ID="lblContactName" runat="server" Text="姓名:" /></td>
                    <td><asp:Label ID="lblContactNameValue" runat="server" /></td>
                </tr>
                <tr>
                    <td><asp:Label ID="lblPhoneNumber" runat="server" Text="电话:" /></td>
                    <td><asp:Label ID="lblPhoneNumberValue" runat="server" /></td>
                </tr>
                <tr>
                    <td><asp:Label ID="lblMemberSince" runat="server" Text="注册:" /></td>  
                    <td><asp:Label ID="lblMemberSinceValue" runat="server" /></td>     
                </tr>
            </table> 
            
            <div id="div-tbxIntro">
                <asp:Label ID="tbxIntro" runat="server" CssClass="tbxIntro" />        
            </div>

            <div class="clear"></div>

        </div>

        <div id="tabs">
            <ul>
                <li><a href="#fragment-1"><span>我的帖子</span></a></li>
                <li><a href="#fragment-2"><span>我的收藏</span></a></li>
                <li><a href="#fragment-3"><span>修改密码</span></a></li>
            </ul>
            <div id="fragment-1" class="div-fragment">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="gvwMyPosts" CssClass="gvwMyPosts" runat="Server" AutoGenerateColumns="false"
                            AllowPaging="true" ShowHeader="false" PagerSettings-Visible="false" OnRowDataBound="gvwMyPostsRowDataBound">
                            <EmptyDataTemplate>
                                <div class="no-result-find"> 
                                    <asp:Localize ID="loc1" runat="server" meta:resourcekey="NoPostsFound" />
                                </div>
                            </EmptyDataTemplate>
                            <Columns>
                                <asp:TemplateField ShowHeader="false">
                                    <ItemTemplate>
                                        <table class="tbl-ad-row">
                                            <tr>
                                                <td rowspan="2" class="td-ad-profile">
                                                    <asp:HyperLink ID="hlkProfilePic" runat="server" CssClass="hlkAdTitle" Target="_blank">
                                                        <asp:Image ID="imgProfile" runat="server" CssClass="imgProfile" />
                                                    </asp:HyperLink>
                                                </td>
                                                <td class="td-ad-detail">
                                                    <div class="vehicle-type">
                                                        <asp:HyperLink ID="hlkAdTitle" runat="server" CssClass="hlkAdTitle" Target="_blank">
                                                            <asp:Label ID="lblVehicleType" runat="server" CssClass="lblVehicleType" />     
                                                        </asp:HyperLink>
                                                        <div class="div-hlkEditPost">
                                                            <asp:HyperLink ID="hlkEditPost" runat="server" Text="管理" CssClass="hlkEditPost" Target="_blank" />
                                                        </div>
                                                        <asp:Label ID="lblStatus" runat="server" CssClass="lblPrice" /> 
                                                    </div>
                                                    <div>
                                                        <asp:Label ID="lblPriceLabel" runat="server" Text="价格:" CssClass="lblLabel" /> 
                                                        <asp:Label ID="lblPrice" runat="server" CssClass="lblPrice" />  
                                                    </div>
                                                    <div class="ad-detail-city">
                                                        <asp:Label ID="lblCityLabel" runat="server" Text="城市:" CssClass="lblLabel" /> 
                                                        <asp:Label ID="lblCity" runat="server" CssClass="lblCity" />  
                                                    </div>
                                                    <div>
                                                        <asp:Label ID="lblPostDateLabel" runat="server" Text="发布时间:" CssClass="lblPostDateLabel lblLabel" /> 
                                                        <asp:Label ID="lblPostDate" runat="server" />     
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <webdiyer:AspNetPager ID="MyPostsPager" runat="server" Width="100%" CssClass="pagination" 
                            OnPageChanged="MyPostsPagerPageChanged" AlwaysShowFirstLastPageNumber="true" CurrentPageButtonClass="CurrentPage"
                            NumericButtonTextFormatString="{0}" ShowPageIndexBox="Never" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div id="fragment-2" class="div-fragment">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:GridView id="gvwMySavedPosts" runat="server" CssClass="gvwMySavedPosts" AutoGenerateColumns="false" DataKeyNames="AdId"
                            AllowPaging="true" ShowHeader="false" PagerSettings-Visible="false" OnRowDataBound="gvwMySavedPostsRowDataBound">
                            <EmptyDataTemplate>
                                <div class="no-result-find"> 
                                    <asp:Localize ID="Localize2" runat="server" meta:resourcekey="NoSavedPostFound" />
                                </div>
                            </EmptyDataTemplate>
                            <Columns>
                                <asp:TemplateField ShowHeader="false">
                                    <ItemTemplate>
                                        <table class="tbl-ad-row">
                                            <tr>
                                                <td rowspan="2" class="td-ad-profile">
                                                    <asp:HyperLink ID="hlkProfilePic" runat="server" CssClass="hlkAdTitle" Target="_blank">
                                                        <asp:Image ID="imgProfile" runat="server" CssClass="imgProfile" />
                                                    </asp:HyperLink>
                                                </td>
                                                <td class="td-ad-detail">
                                                    <div class="vehicle-type">
                                                        <asp:HyperLink ID="hlkAdTitle" runat="server" CssClass="hlkAdTitle" Target="_blank">
                                                            <asp:Label ID="lblVehicleType" runat="server" CssClass="lblVehicleType" />     
                                                        </asp:HyperLink>
                                                        <div class="div-lbtRemoveFromSaved">
                                                            <asp:LinkButton ID="lbtRemoveFromSaved" runat="server" OnClick="RemoveFromSavedClick" meta:resourcekey="lbtRemoveFromSaved" />
                                                        </div>
                                                        <ajaxToolkit:ConfirmButtonExtender ID="cbe" runat="server"
                                                            TargetControlID="lbtRemoveFromSaved" meta:resourcekey="ConfirmRemoveFromSaved" />
                                                    </div>
                                                    <div>
                                                        <asp:Label ID="lblPriceLabel" runat="server" Text="价格:" />
                                                        <asp:Label ID="lblPrice" runat="server" />  
                                                    </div>
                                                    <div class="ad-detail-city">
                                                        <asp:Label ID="lblCityLabel" runat="server" Text="城市:" CssClass="lblLabel" /> 
                                                        <asp:Label ID="lblCity" runat="server" CssClass="lblCity" />  
                                                    </div>
                                                    <div>
                                                        <asp:Label ID="lblPostDateLabel" runat="server" Text="发布时间:" CssClass="lblPostDateLabel lblLabel" /> 
                                                        <asp:Label ID="lblPostDate" runat="server" />     
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>    
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <webdiyer:AspNetPager ID="SavedPostsPager" runat="server" Width="100%" CssClass="pagination" CurrentPageButtonClass="CurrentPage"
                            OnPageChanged="SavedPostsPagerPageChanged" AlwaysShowFirstLastPageNumber="true"
                            NumericButtonTextFormatString="{0}" ShowPageIndexBox="Never" />
                        </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div id="fragment-3">
                <asp:UpdatePanel ID="udpChangePass" runat="server">
                    <ContentTemplate>
                        <table id="tbl-chg-pwd">
                            <tr>
                                <td class="td-label">旧密码</td>
                                <td><asp:TextBox ID="txtCurrentPassword" runat="server" TextMode="Password" CssClass="input-tbx" /></td>
                            </tr>
                            <tr>
                                <td class="new-pwd-td" />
                                <td class="new-pwd-td" />
                            </tr>
                            <tr>
                                <td class="td-label">新密码</td>
                                <td><asp:TextBox ID="txtNewPassword" runat="server" TextMode="Password" CssClass="input-tbx" /></td>
                            </tr>
                            <tr>
                                <td class="td-label">重复新密码</td>
                                <td><asp:TextBox ID="txtConfirmPassword" runat="server" TextMode="Password" CssClass="input-tbx" /></td>
                            </tr>
                            <tr>
                                <td class="new-pwd-td"/>
                                <td class="new-pwd-td">
                                    <asp:LinkButton ID="btnChangePassword" runat="server" Text="提交" OnClick="btnChangePasswordClick" 
                                        class="btnChangePassword" />
                                    <asp:Label ID="lblChangePasswordMessage" runat="server" CssClass="error-message" /> 
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
</asp:Content>
